package com.qulai.amazon_us.service.amazon_us.impl;

import java.util.List;
import com.qulai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.qulai.amazon_us.mapper.amazon_us.AmazonUsContentMapper;
import com.qulai.amazon_us.domain.amazon_us.AmazonUsContent;
import com.qulai.amazon_us.service.amazon_us.IAmazonUsContentService;

/**
 * 文案Service业务层处理
 * 
 * @author hunan
 * @date 2025-01-05
 */
@Service
public class AmazonUsContentServiceImpl implements IAmazonUsContentService 
{
    @Autowired
    private AmazonUsContentMapper amazonUsContentMapper;

    /**
     * 查询文案
     * 
     * @param id 文案主键
     * @return 文案
     */
    @Override
    public AmazonUsContent selectAmazonUsContentById(Long id)
    {
        return amazonUsContentMapper.selectAmazonUsContentById(id);
    }

    /**
     * 查询文案列表
     * 
     * @param amazonUsContent 文案
     * @return 文案
     */
    @Override
    public List<AmazonUsContent> selectAmazonUsContentList(AmazonUsContent amazonUsContent)
    {
        return amazonUsContentMapper.selectAmazonUsContentList(amazonUsContent);
    }

    /**
     * 新增文案
     * 
     * @param amazonUsContent 文案
     * @return 结果
     */
    @Override
    public int insertAmazonUsContent(AmazonUsContent amazonUsContent)
    {
        amazonUsContent.setCreateTime(DateUtils.getNowDate());
        return amazonUsContentMapper.insertAmazonUsContent(amazonUsContent);
    }

    /**
     * 修改文案
     * 
     * @param amazonUsContent 文案
     * @return 结果
     */
    @Override
    public int updateAmazonUsContent(AmazonUsContent amazonUsContent)
    {
        amazonUsContent.setUpdateTime(DateUtils.getNowDate());
        return amazonUsContentMapper.updateAmazonUsContent(amazonUsContent);
    }

    /**
     * 批量删除文案
     * 
     * @param ids 需要删除的文案主键
     * @return 结果
     */
    @Override
    public int deleteAmazonUsContentByIds(Long[] ids)
    {
        return amazonUsContentMapper.deleteAmazonUsContentByIds(ids);
    }

    /**
     * 删除文案信息
     * 
     * @param id 文案主键
     * @return 结果
     */
    @Override
    public int deleteAmazonUsContentById(Long id)
    {
        return amazonUsContentMapper.deleteAmazonUsContentById(id);
    }
}
